using System;
using System.Collections.Generic;
using Common.Unity.Extensions.PropertyMapper.Policies;
using Microsoft.Practices.ObjectBuilder2;

namespace Common.Unity.Extensions.PropertyMapper.Policies
{
	public abstract class PropertyMappingPolicyBase : IPropertyMappingPolicy
	{
		protected abstract IEnumerable<IPropertySetterInfo> ResolveProperties( PropertyMappingContext context );

		public void AddProperties( PropertyMappingContext mappingContext, ICollection<IPropertySetterInfo> properties )
		{
			foreach ( IPropertySetterInfo info in ResolveProperties( mappingContext ) )
			{
				properties.Add( info );
			}
		}
	}
}